using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._WorkflowManagerTools._Configuration
{
    /// <summary>
    /// <para>Upgrade Workflow Database</para>
    /// <para>Upgrades an existing Workflow Manager (Classic) database with the latest  schema and configuration. The Workflow Manager (Classic) database is used to store the job and configuration information for your work management system and one feature class that is used to store the geometries for the location of interest (LOI) for your jobs.</para>
    /// <para>使用最新的方案和配置升级现有 Workflow Manager （Classic） 数据库。Workflow Manager （Classic） 数据库用于存储工作管理系统的作业和配置信息，以及一个要素类，该要素类用于存储作业的感兴趣位置 （LOI） 的几何。</para>
    /// </summary>    
    [DisplayName("Upgrade Workflow Database")]
    public class UpgradeWorkflowDatabase : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public UpgradeWorkflowDatabase()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Database_Connection">
        /// <para>Input Database Connection</para>
        /// <para>The location of the enterprise geodatabase connection file to the Workflow Manager (Classic) database, which contains Workflow Manager (Classic) system tables. The connection file must connect directly to the database, and the connection should be made as a database owner.</para>
        /// <para>企业级地理数据库连接文件与 Workflow Manager （Classic） 数据库的位置，该数据库包含 Workflow Manager （Classic） 系统表。连接文件必须直接连接到数据库，并且应以数据库所有者的身份进行连接。</para>
        /// </param>
        public UpgradeWorkflowDatabase(object _Input_Database_Connection)
        {
            this._Input_Database_Connection = _Input_Database_Connection;
        }
        public override string ToolboxName => "Workflow Manager Tools";

        public override string ToolName => "Upgrade Workflow Database";

        public override string CallName => "wmx.UpgradeWorkflowDatabase";

        public override List<string> AcceptEnvironments => ["configKeyword"];

        public override object[] ParameterInfo => [_Input_Database_Connection, _User_Store.GetGPValue(), _Output_DatabasePath];

        /// <summary>
        /// <para>Input Database Connection</para>
        /// <para>The location of the enterprise geodatabase connection file to the Workflow Manager (Classic) database, which contains Workflow Manager (Classic) system tables. The connection file must connect directly to the database, and the connection should be made as a database owner.</para>
        /// <para>企业级地理数据库连接文件与 Workflow Manager （Classic） 数据库的位置，该数据库包含 Workflow Manager （Classic） 系统表。连接文件必须直接连接到数据库，并且应以数据库所有者的身份进行连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Database Connection")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Database_Connection { get; set; }


        /// <summary>
        /// <para>User Store</para>
        /// <para><xdoc>
        ///   <para>Specifies the user store from which the users and roles will be retrieved. The users can be imported from a portal and are assigned to roles created in the Workflow Manager (Classic) repository. The portal user profile information cannot be edited using ArcGIS Workflow Manager (Classic) Administrator. The users and roles can be created in the Workflow Manager (Classic) repository using the Traditional option. When using the Traditional option, the users and roles can be imported from the Active Directory in ArcGIS Workflow Manager (Classic) Administrator.</para>
        ///   <bulletList>
        ///     <bullet_item>Portal—The users will be imported from the portal you are currently signed in to.</bullet_item><para/>
        ///     <bullet_item>Traditional—The users and roles will be created in the Workflow Manager (Classic) repository using ArcGIS Workflow Manager (Classic) Administrator. Users and roles can be imported from the Active Directory when this option is used. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将从中检索用户和角色的用户存储。可以从门户导入用户，并将其分配给在 Workflow Manager （Classic） 资料档案档案库中创建的角色。无法使用 ArcGIS Workflow Manager （Classic） 管理器编辑门户用户配置文件信息。可以使用传统选项在 Workflow Manager （Classic） 资料档案档案库中创建用户和角色。使用传统选项时，可以从 ArcGIS Workflow Manager （Classic） 管理器中的 Active Directory 导入用户和角色。</para>
        ///   <bulletList>
        ///     <bullet_item>门户 - 将从您当前登录的门户导入用户。</bullet_item><para/>
        ///     <bullet_item>传统 - 将使用 ArcGIS Workflow Manager （Classic） 管理器在 Workflow Manager （Classic） 资料档案档案库中创建用户和角色。使用此选项时，可以从 Active Directory 导入用户和角色。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("User Store")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _User_Store_value? _User_Store { get; set; } = null;

        public enum _User_Store_value
        {
            /// <summary>
            /// <para>Traditional</para>
            /// <para>Traditional—The users and roles will be created in the Workflow Manager (Classic) repository using ArcGIS Workflow Manager (Classic) Administrator. Users and roles can be imported from the Active Directory when this option is used. This is the default.</para>
            /// <para>传统 - 将使用 ArcGIS Workflow Manager （Classic） 管理器在 Workflow Manager （Classic） 资料档案档案库中创建用户和角色。使用此选项时，可以从 Active Directory 导入用户和角色。这是默认设置。</para>
            /// </summary>
            [Description("Traditional")]
            [GPEnumValue("TRADITIONAL")]
            _TRADITIONAL,

            /// <summary>
            /// <para>Portal</para>
            /// <para>Portal—The users will be imported from the portal you are currently signed in to.</para>
            /// <para>门户 - 将从您当前登录的门户导入用户。</para>
            /// </summary>
            [Description("Portal")]
            [GPEnumValue("PORTAL")]
            _PORTAL,

        }

        /// <summary>
        /// <para>Output Database Path (.jtc)</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Database Path (.jtc)")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _Output_DatabasePath { get; set; }


        public UpgradeWorkflowDatabase SetEnv(object configKeyword = null)
        {
            base.SetEnv(configKeyword: configKeyword);
            return this;
        }

    }

}